package com.amazon.controller;

import com.amazon.model.*;
import com.amazon.service.BusinessReportService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
@RestController
@RequestMapping("/amazon")
public class BusinessReportController {
    @Resource
    private BusinessReportService reportService;
    @GetMapping("/businessReport")
    public CommonResult businessReport(Long startTime, Long endTime,Integer mouth){
        MonthModel monthModel = reportService.businessReport(startTime, endTime, mouth);
        return CommonResult.ok(monthModel);
    }

    @GetMapping("/toDaybusinessReport")
    public CommonResult toDaybusinessReport(){
        TodayBusinessModel todayBusinessModel = reportService.toDaybusinessReport();
        return CommonResult.ok(todayBusinessModel);
    }

    @GetMapping("/advert")
    public CommonResult advert(){
        AdvertModel adverInfo = reportService.getAdverInfo();
        return CommonResult.ok(adverInfo);
    }
}
